//平台属性和属性值接口
//引入二次封装axios
import request from '@/utils/request';
//api相关接口

enum API {
	//一级分类
	getC1 = '/admin/product/getCategory1',
	//二级分类
	getC2 = '/admin/product/getCategory2/',
	//三级分类
	getC3 = '/admin/product/getCategory3/',
	//一级分类
	getAttr = '/admin/product/attrInfoList/',
	//添加平台属性
	addOrUpdateAttr = '/admin/product/saveAttrInfo',
}

//分别暴漏接口
//一级分类
export const reqC1 = () => request.get(API.getC1);
//二级分类
export const reqC2 = (c1Id: number | string) => request.get(API.getC2 + c1Id);
//三级分类
export const reqC3 = (c2Id: number | string) => request.get(API.getC3 + c2Id);
//平台属性和属性值
export const reqAttr = (
	c1Id: number | string,
	c2Id: number | string,
	c3Id: number | string
) => request.get(API.getAttr + `${c1Id}/${c2Id}/${c3Id}`);

//新增或修改平台属性
export const reqAddOrUpdateAttr = (data: any) =>
	request.post(API.addOrUpdateAttr, data);
